package com.ysh.domain;
/*
    用户实体类，对应着数据库中的user表
 */
public class User {
    private String id;        // 用户编号
    private String name;      // 用户姓名
    private Integer gender;   // 性别：0：男，1：女
    private String genderStr; // 用于页面显示，0：男，1：女
    private Integer age;      // 年龄
    private String address;   // 籍贯,id值
    private City city;        // address对应的籍贯名称
    private String  qq;       // qq号码

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

    private String email;     // 邮箱

    public User() {
    }

    public User(String id, String name, Integer gender, Integer age, String address, String qq, String email) {
        this.id = id;
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.address = address;
        this.qq = qq;
        this.email = email;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getGenderStr() {
        if (gender == 0){
            genderStr="男";
        }else if (gender == 1){
            genderStr="女";
        }else{
            genderStr = "其他";
        }
        return genderStr;
    }

    public void setGenderStr(String genderStr) {
        this.genderStr = genderStr;
    }
}
